curl -L https://cdn.natapp.cn/assets/downloads/clients/2_4_0/natapp_linux_amd64/natapp -O
sudo mkdir /usr/natapp
sudo cp natapp /usr/natapp/ && sudo chmod a+x /usr/natapp/natapp

# 存放位置 /usr/lib/systemd/system
# 开启 systemctl start natapp
# 关闭 systemctl stop natapp
# 开机启动 systemctl enable natapp
# 取消开机启动 system disable natapp

cat << EOF > nginx.conf

[Unit]
Description=NatApp Service
Wants=network-online.target
After=network.target

[Service]
Type=simple
# ExecStart=/usr/local/natapp/natapp -authtoken=2cc060d0583f40c0 -log=stdout
ExecStart=/usr/local/natapp/natapp -authtoken=1d8c78f1774825db -log=stdout

# Suppress stderr to eliminate duplicated messages in syslog. NM calls openlog()
# with LOG_PERROR when run in foreground. But systemd redirects stderr to
# syslog by default, which results in logging each message twice.

StandardOutput=syslog
StandardError=null

[Install]
WantedBy=multi-user.target

EOF

sudo cp natapp.service /usr/lib/systemd/system/
sudo systemctl stop natapp
sudo systemctl start natapp
sudo systemctl enable natapp

# 存放位置 /usr/lib/systemd/system
# 开启 systemctl start natapp
# 关闭 systemctl stop natapp
# 开机启动 systemctl enable natapp
# 取消开机启动 system disable natapp